The CxHmiCas3 object contains the following methods:
The AddFilter method changes the current unit set.
AddFilter(Property As String, Operator As String, Value As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Property |
Yes |
The property being filtered. |
|
Operator |
Yes |
The operator that compares the property to the value. |
|
Value |
Yes |
The value being compared to the property. |
This is the legacy function that was used to add filters. With the new implementation of rules, this function will only allow adding a single rule with the given values to the highest level rule set. This will preserve backwards compatibility but should not be used.
This method filters the displayed alarms by the property, operator, and value given. If the method returns False, there was an error in adding the filter.
Example
|
Sub btnAddFilter_EventClick() Dim This : Set This = btnAddFilter Dim bRet Dim strProperty Dim strOperator Dim strValue
'Displays alarms where the Primary Value is greater than 600 strProperty = "Primary Value" strOperator = ">" strValue = 600
bRet = CasCtrl.AddFilter(strProperty, strOperator, strValue)
If (bRet <> True) Then Msgbox("Error in AddFilter!") End If
CasCtrl.RefreshContents
End Sub |
The AllowUserChanges method allows or disallows the user to change properties at runtime.
AllowUserChanges(Allow As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Allow |
Yes |
If this parameter is set to True, the user is allowed to make changes to the form. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim g_bAllowChanges If (g_bAllowChanges = True) Then g_bAllowChanges = False Else g_bAllowChanges = True End If
CasCtrl.AllowUserChanges g_bAllowChanges
End Sub |
The ClearFilters method clears all rules and filters from the control.
ClearFilters()
Example
The following example clears all rules from CasCtrl and alerts the user.
|
Sub clearFilters() CasCtrl.ClearFilters CasCtrl.RefreshContents MsgBox "Rules have been cleared" End Sub |
The ClearSilenceTime method clears out any alarm silence time that may have been set. This will cause any alarms that would cause sound to be played, but had been silenced, to resume playing sound.
ClearSilenceTime()
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.ClearSilenceTime End Sub |
The EnableAllRules method enables or disables all rules and vectors, either unilaterally, or for the specified level. Passing True for Enable enables all rules; passing False disables all rules.
EnableAllRules(Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Enable |
Yes |
If this parameter is set to True, all rules will be enabled. Otherwise, all rules will be disabled. |
Example
The following example toggles whether all rules are enabled or disabled.
|
Sub enableAllRules() If enableState = True Then CasCtrl.EnableAllRules(False) enableState = False Else CasCtrl.EnableAllRules(True) enableState = True End If CasCtrl.RefreshContents End Sub |
The EnableCASViewCustomAttributeFiltering method enables or disables the use of CAS custom attributes.
EnableCASViewCustomAttributeFiltering(Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Enable |
Yes |
If this parameter is set to True, custom attribute filtering will be enabled. Otherwise, custom attribute filtering will be disabled. |
This method is used by CygNet Explorer, and should not be used in script.
Example
The following example toggles custom attribute filtering and alerts the user that it has been enabled or disabled.
|
Sub enableCustomAttrFiltering() If bEnabled Then CasCtrl.EnableCASViewCustomAttributeFiltering False bEnabled = False edtMessageBox.Text = "Custom attribute filtering is now disabled" Else CasCtrl.EnableCASViewCustomAttributeFiltering True bEnabled = True edtMessageBox.Text = "Custom attribute filtering is now enabled" End If End Sub |
The EnableDClickPropDlg method enables or disables launching of a Point Properties dialog box when a row is double-clicked.
EnableDClickPropDlg(Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Enable |
Yes |
If this parameter is set to True, a Point Properties dialog box will be invoked when a row is double-clicked. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim g_bEnableDialog If (g_bEnableDialog = True) Then g_bEnableDialog = False Else g_bEnableDialog = True End If
CasCtrl.EnableDClickPropDlg g_bEnableDialog End Sub |
The EnableRule method enables or disables the specified rule or set of rules for the specified level. True enables the rule or vector; False disables it.
EnableRule(Name As String, Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Name |
Yes |
The name of the rule(s) to enable or disable. |
|
Enable |
Yes |
If this parameter is set to True, the rule(s) will be enabled. Otherwise, the rule(s) will be disabled. |
Example
The following example toggles the enabled state of TestRule.
|
Sub enableRule() If enableState = True Then CasCtrl.EnableRule "TestRule", False enableState = False Else CasCtrl.EnableRule "TesRule", True enableState = True End If
CasCtrl.RefreshContents MsgBox enableState End Sub |
The EnableSound method enables or disables sounds for a particular alarm priority category.
EnableSound(Enable As Boolean, Category As Long, SoundFilePath As String)
| Parameter | Required | Description |
|---|---|---|
|
Enable |
Yes |
If this parameter is set to True, sounds will be enabled for the alarm priority category number specified in the Category parameter. Otherwise, sounds will be disabled for that Category. |
|
Category |
Yes |
The category of the alarm that will play a sound. |
|
SoundFilePath |
Yes |
The file path or blob path to the sound file to be played. |
If enabled, a sound will play when an alarm goes off. Different alarm categories can be configured to trigger different sounds.
Example
|
Sub btnEnableSound_EventClick() Dim This : Set This = btnEnableSound Dim bRet Dim bEnable Dim lCategory Dim strFilePath
If bEnable = True then bEnable = False Else bEnable = True End If
lCategory = "GASCONTROL" strFilePath = "C:\sound.wav"
bRet = CasCtrl.EnableSound(bEnable, lCategory, strFilePath)
If (bRet <> True) Then Msgbox("Error in EnableSound!") End If
End Sub |
The GetAlarmRefreshSec method returns the alarm refresh rate in seconds.
GetAlarmRefreshSec() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lAlarmSec lAlarmSec = CasCtrl.GetAlarmRefreshSec txtTool = lAlarmSec End Sub |
The GetCASViewCustomAttribute method returns the value of a CAS View Control custom attribute by either the supplied attribute name or description.
GetCASViewCustomAttribute(AttributeNameOrDesc As String) as String
| Parameter | Required | Description |
|---|---|---|
|
AttributeNameorDesc |
Yes |
The name or description of the custom attribute for which to retrieve a value. |
Example
The following example retrieves the value for the first custom attribute and stores it in an edit box.
|
Sub getCustomAttr() Dim strValue strValue = CasCtrl.GetCASViewCustomAttribute("cas_view_attribute_0") edtMessageBox.Text = "Custom attribute value is " & strValue End Sub |
The GetFilter method returns the XML representation of the set of filter rules.
GetFilter() As String
The following is an example of the XML string returned by this method.
|
<XML><FilterDefinition m_dwProperty="10110"m_eOperator="4"m_iVersionXml="0"/></XML> |
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strFilter strFilter = CasCtrl.GetFilter txtTool.Text = strFilter End Sub |
The GetFilterString method returns the string representation of the filter.
GetFilterString() As String
This method returns the basic string representation of the filter (for example, "Alarm Priority > 74").
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strFilter strFilter = CasCtrl.GetFilterString txtTool = strFilter End Sub |
The GetFirstVisibleAlarm method returns the row of the first alarm visible on the screen.
GetFirstVisibleAlarm() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lFirstAlarm lFirstAlarm = CasCtrl.GetFirstVisibleAlarm txtTool = lFirstAlarm End Sub |
The GetGridValueForTag method returns the grid value for a specified point property.
GetGridValue(Tag As String, Property As String) As String
| Parameter | Required | Description |
|---|---|---|
|
Tag |
Yes |
The tag of the point from which to retrieve the property value. |
|
Property |
Yes |
The property of which the grid value will be retrieved. This parameter must be in SITE.SERVICE.POINTID:LONGPOINTID format. |
The value returned by this method is the value shown in the CAS View Control grid for the specified property.
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim GridValue GridValue = CasCtrl.GetPropertyForTag(Tag, "Alarm Condition") txtTool = GridValue End Sub |
The GetLastVisibleAlarm method returns the row of the last alarm visible on the screen.
GetLastVisibleAlarm() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lLastAlarm lLastAlarm = CasCtrl.GetLastVisibleAlarm txtTool = lLastAlarm End Sub |
The GetNumberRows method returns the total number of rows (alarms) in the grid.
GetNumberRows() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lNumberRows lNumberRows = CasCtrl.GetNumberRows txtTool = lNumberRows End Sub |
The GetPropertyForTag method returns a property value for a specified point.
GetPropertyForTag(Tag As String, Property As String) As String
| Parameter | Required | Description |
|---|---|---|
|
Tag |
Yes |
The tag of the point from which to retrieve the property value. This parameter must be in SITE.SERVICE.POINTID:LONGPOINTID format. |
|
Property |
Yes |
The property of which the value will be retrieved. |
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strProperty strProperty = CasCtrl.GetPropertyForTag(Tag, "Alarm Condition") txtTool = strProperty End Sub |
The GetRuleNames method returns the names of all rules or sets of rules that have a configured name for the specified level. Separate arrays are returned for rules that are enabled and for rules that are disabled.
GetRuleNames(EnabledNames As Variant[out], DisabledNames As Variant[out])
| Parameter | Required | Description |
|---|---|---|
|
EnabledNames |
Yes |
The array of enabled rule names returned by this method. |
|
DisabledNames |
Yes |
The array of disabled rule names returned by this method. |
Example
The following example retrieves two arrays of enabled and disabled rule names, then displays them in two listboxes.
|
Sub getRuleNames() Dim arrEnabled, arrDisabled, item CasCtrl.GetRuleNames arrEnabled, arrDisabled
'Add enabled names to a list box For Each item In arrEnabled lboEnabled.AddString(item) Next
'Add disabled names to a list box For Each item In arrDisabled lboDisabled.AddString(item) Next End Sub |
The GetRunningServices method returns the alarm category of the selected alarm.
GetRunningServices() As Variant
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim iBndLower Dim iBndUpper Dim arrServiceList Dim nItem
ListBox1.ResetContent
arrServiceList = CasCtrl.GetRunningServices
iBndLower = LBound(arrServiceList) iBndUpper = UBound(arrServiceList)
For nItem = iBndLower To iBndUpper ListBox1.AddString CStr(arrServiceList(nItem)) Next End Sub |
The GetSelectedAlarmCategory method returns the alarm category of the selected alarm.
GetSelectedAlarmCategory() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strCategory strCategory = CasCtrl.GetSelectedAlarmCategory txtTool = strCategory End Sub |
The GetSelectedAlarmFacility method returns the facility ID of the selected alarm.
GetSelectedAlarmFacility() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strFacility strFacility = CasCtrl.GetSelectedAlarmFacility txtTool = strFacility End Sub |
The GetSelectedAlarmPointId method returns the short point ID of the selected alarm.
GetSelectedAlarmPointID() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strPointID strPointID = CasCtrl.GetSelectedAlarmPointID txtTool = strPointID End Sub |
The GetSelectedAlarmPointIdLong method returns the long point ID of the selected alarm.
GetSelectedAlarmPointIDLong() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strLongID strLongID = CasCtrl.GetSelectedAlarmPointIDLong txtTool = strLongID End Sub |
The GetSelectedAlarmPriority method returns the alarm priority of the selected alarm.
GetSelectedAlarmPriority() As Integer
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim iPriority iPriority = CasCtrl.GetSelectedAlarmPriority txtTool = iPriority End Sub |
The GetSelectedAlarms method returns an array of point tags of the currently-selected alarms.
GetSelectedAlarms()As Variant
The point tags included in the returned array are in SITE.SERVICE.POINTID:LONGPOINTID format.
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim iBndLower Dim iBndUpper Dim arrAlarmList Dim nItem
ListBox1.ResetContent
arrAlarmList = CasCtrl.GetSelectedAlarms
iBndLower = LBound(arrAlarmList) iBndUpper = UBound(arrAlarmList)
For nItem = iBndLower To iBndUpper ListBox1.AddString CStr(arrAlarmList(nItem)) Next
End Sub |
The GetSelectedAlarmService method returns the service of the selected alarm.
GetSelectedAlarmService() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strService strService = CasCtrl.GetSelectedAlarmService txtTool = strService End Sub |
The GetSelectedAlarmSite method returns the site of the selected alarm.
GetSelectedAlarmSite() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strSite strSite = CasCtrl.GetSelectedAlarmSite txtTool = strSite End Sub |
The GetSelectedAlarmStatus method returns the status of the selected alarm.
GetSelectedAlarmStatus() As Integer
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim iAlarmStatus iAlarmStatus = CasCtrl.GetSelectedAlarmStatus txtTool = iAlarmStatus End Sub |
The GetSelectedAlarmTimestamp method returns the latest timestamp of the selected alarm.
GetSelectedAlarmTimestamp() As String
This method returns a string including the date and time, in 24-hour time notation (for example, "5/28/2019 15:01:46.624").
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strTimestamp strTimestamp = CasCtrl.GetSelectedAlarmTimestamp txtTool = strTimestamp End Sub |
The GetSelectedAlarmUniformDataCode method returns the uniform data code of the selected alarm.
GetSelectedAlarmUniformDataCode() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strDataCode strDataCode = CasCtrl.GetSelectedAlarmUniformDataCode txtTool = strDataCode End Sub |
The GetSelectedAlarmUserStatus method returns the user status of the selected alarm.
GetSelectedAlarmUserStatus() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lAlarmSec lAlarmSec = CasCtrl.GetSelectedAlarmUserStatus txtTool = lAlarmSec End Sub |
The GetSelectedAlarmValue method returns the value of the selected alarm.
GetSelectedAlarmValue() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strAlarmValue strAlarmValue = CasCtrl.GetSelectedAlarmValue txtTool = strAlarmValue End Sub |
The GetServiceVersionNumber method returns the service version of the currently-selected alarm.
GetServiceVersionNumber() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lServiceVersion lServiceVersion = CasCtrl.GetServiceVersionNumber txtTool = lServiceVersion End Sub |
The GetStoppedServices method returns the list of stopped services.
GetStoppedServices() As Variant
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim iBndLower Dim iBndUpper Dim arrStoppedService Dim nItem
ListBox1.ResetContent
arrStoppedService = CasCtrl.GetStoppedServices
iBndLower = LBound(arrStoppedService) iBndUpper = UBound(arrStoppedService)
For nItem = iBndLower To iBndUpper ListBox1.AddString CStr(arrStoppedService (nItem)) Next
End Sub |
The GetTagForRow method returns the alarm tag for the specified row.
GetTagForRow(Row As Long) As String
| Parameter | Required | Description |
|---|---|---|
|
Row |
Yes |
The row for which the alarm tag will be retrieved. |
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strTag strTag = CasCtrl.GetTagForRow(10) txtTool = strTag End Sub |
The GetTooltipRow method returns tooltip row information.
GetTooltipRow() As Long
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim lTooltipRow lTooltipRow = CasCtrl.GetTooltipRow txtTool = lTooltipRow End Sub |
The GetTooltipString method returns the tooltip display string.
GetTooltipString() As String
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl Dim strTooltipString strTooltipString = CasCtrl.GetTooltipString txtTool = strTooltipString End Sub |
The GetTooltipText method returns tooltip text information.
GetTooltipText(TooltipRow As Long) As String
| Parameter | Required | Description |
|---|---|---|
|
TooltipRow |
Yes |
The row for which the tooltip text information will be retrieved. |
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl strToolTip = CasCtrl.GetTooltipText(iRow) txtTool = strToolTip End Sub |
The IsSelectedAlarmAck method returns True if the currently-selected alarm is acknowledged.
IsSelectedAlarmAck() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsSelectedAlarmAck = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The IsSelectedAlarmClear method returns True if the currently-selected alarm is clear.
IsSelectedAlarmClear() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsSelectedAlarmClear = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The IsSelectedAlarmHidden method returns True if the currently-selected alarm is hidden.
IsSelectedAlarmHidden() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsSelectedAlarmHidden = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The IsSelectedAlarmSet method returns True if the currently-selected alarm is set.
IsSelectedAlarmSet() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsSelectedAlarmSet = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The IsSelectedAlarmSuppressed method returns True if the currently-selected alarm is suppressed.
IsSelectedAlarmSuppressed() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsSelectedAlarmSuppressed = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The IsShowAlarmColor method returns the value of the ShowLineColor property.
IsShowAlarmColor() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsShowAlarmColor = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The IsWrapColumns method returns the value of the WrapColumns property.
IsWrapColumns() As Boolean
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl If CasCtrl.IsWrapColumns = True Then txtTool = "True" Else txtTool = "False" End If End Sub |
The MenuSelection method selects an item from the context menu.
MenuSelection(MenuSel As Integer)
| Parameter | Required | Description |
|---|---|---|
|
MenuSel |
Yes |
The number code for the menu selection. |
The MenuSel parameter can be one of the following integers.
| Menu Action | Code |
|---|---|
| Filter | 1000 |
| Columns | 1001 |
| Clear | 1002 |
| Properties | 1003 |
| Acknowledge | 1004 |
| Configure_Alarm | 1005 |
| Configure_Comment | 1006 |
| Configure_All | 1007 |
| Force_Clear | 1008 |
| Hide | 1009 |
| Unhide | 1010 |
| Stats | 1011 |
| Select_All | 1012 |
| Line_Color | 1013 |
| Auto_Config | 1014 |
| Print_Report | 1015 |
| Refresh | 1016 |
| Wrap_Cols | 1017 |
| Acknowledge_Visible | 1018 |
| History | 1019 |
| Sound | 1020 |
| Suppress | 1021 |
Example
|
Sub CasCtrl_EventAlarmDblClicked(iRow, Tag) Dim This : Set This = CasCtrl 'Calls the suppression dialog box CasCtrl.MenuSelection(1021) End Sub |
The Properties method invokes a Point Properties dialog box for the currently-selected alarm.
Properties()
Example
|
Sub CasCtrl_EventAlarmSelected(iRow, Tag) Dim This : Set This = CasCtrl CasCtrl.Properties End Sub |
The RefreshContents method refreshes the contents of the CAS View control with all alarms that meet the configured set of rules. After modifying the filter rules, this must be called to reset the view with the changes.
RefreshContents()
Call this method to update the grid after calling any other method that changes the CAS display.
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.RefreshContents End Sub |
The RemoveFilter method removes a filter specified by a property, operator, and value.
RemoveFilter(Property As String, Operator As String, Value As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Property |
Yes |
The property being filtered. |
|
Operator |
Yes |
The operator that compares the property to the value. |
|
Value |
Yes |
The value being compared to the property. |
This is an obsolete legacy function. For compatibility, it will remove the specified rule if it is found in the highest-level rule set only.
This method will return False if there is an error removing the filter.
Example
|
Sub btnRemoveFilter_EventClick() Dim This : Set This = btnRemoveFilter Dim bRet Dim strProperty Dim strOperator Dim strValue
strProperty = "Primary Value" strOperator = ">" strValue = 600
bRet = CasCtrl.RemoveFilter(strProperty, strOperator, strValue)
If (bRet <> True) Then Msgbox("Error in RemoveFilter!") End If
CasCtrl.RefreshContents
End Sub |
The RequestAlarmRefreshRateChange method requests a change in the shared alarm cache refresh rate.
RequestAlarmRefreshRateChange(RequestedSeconds As Long, ActualRefreshSeconds As Variant) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
RequestedSeconds |
Yes |
The requested number of seconds between shared alarm cache refreshes. |
|
ActualRefreshSeconds |
Yes |
The actual refresh rate of the shared alarm cache returned by this method, in seconds. |
This method will return True upon success and False upon failure.
This method will only succeed if the request refresh rate is faster than that of other shared controls in the application.
Example
The following example requests a shared alarm cache refresh rate of 10 seconds, and displays the actual refresh rate in a message box.
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim nRefreshRate CasCtrl.RequestAlarmRefreshRateChange(10, nRefreshRate)
MsgBox nRefreshRate End Sub |
The RestoreInitialFilter method restores the filter state to the original filter that is configured for the control.
RetoreInitialFilter()
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.RestoreInitialFilter CasCtrl.RefreshContents End Sub |
The SelectAlarms method selects a range of alarms.
SelectAlarms(FirstAlarm As Long, LastAlarm As Long) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
FirstAlarm |
Yes |
The first alarm in the range to select. |
|
LastAlarm |
Yes |
The last alarm in the range to select. |
Example
|
Sub btnSuppress_EventClick() Dim This : Set This = btnSuppress Dim firstAlarm Dim lastAlarm
firstAlarm = edtAlarm1.Text lastAlarm = edtAlarm2.Text
CasCtrl.SelectAlarms firstAlarm, lastAlarm End Sub |
The SetAlarmRefreshSec method sets the alarm refresh rate in seconds.
SetAlarmRefreshSec(Seconds As Long)
| Parameter | Required | Description |
|---|---|---|
|
Seconds |
Yes |
The amount of time in seconds to wait between alarm refreshes. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim lSeconds lSeconds = edtTool.Text casctrl.SetAlarmRefreshSec(lSeconds) End Sub |
The SetCASViewCustomAttribute method sets the value of a CAS View Control custom attribute identified by either the attribute name or description.
SetCASViewCustomAttribute(AttributeNameOrDesc As String, Value As String)
| Parameter | Required | Description |
|---|---|---|
|
AttributeNameOrDesc |
Yes |
The name or description of the custom attribute for which to set a value. |
|
Value |
Yes |
The value to set for the attribute. |
Example
The following example demonstrates the two ways to set a custom attribute. The first method uses the custom attribute’s description, and the second method uses the custom attribute’s name.
|
Sub setCustomAttr() 'Set by custom attribute description CasCtrl.SetCASViewCustomAttribute "View Facility", "CygDemo_RTU"
'Set by custom attribute name CasCtrl.SetCASViewCustomAttribute "cas_view_attribute_0", "CygDemo_RTU" End Sub |
The SetControlLabel method sets the control’s label for identification in the log file.
SetControlLabel(Label As String)
| Parameter | Required | Description |
|---|---|---|
|
Label |
Yes |
The prefix used to identify the control in the log file. |
The prefix specified in the Label parameter is only appended to logs of certain errors and actions.
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.SetControlLabel("CAS Screen") End Sub |
The SetFilter method creates a filter rule set for the CAS View Control with the provided XML string.
SetFilter(Filter As String)
| Parameter | Required | Description |
|---|---|---|
|
Filter |
Yes |
The XML representing the filter to create. |
The XML specified in the Filter parameter is in the same format as the XML returned by the GetFilter method. This function will accept the obsolete form of the Filter XML String from previous versions of the CAS View Control GetFilter function.
Example
|
Sub ButtonTool5_EventClick() Dim This : Set This = ButtonTool5 Dim NewFilter NewFilter = edtBox.Text '<XML><FilterDefinition m_dwProperty="10110" m_eOperator="4" 'm_iVersionXml="0" m_strValues="74"/></XML>
CasCtrl.SetFilter (edtBox.Text) casctrl.RefreshContents End Sub |
The SetSiteServices method sets the list of Site.Services for which to display alarms.
SetSiteServices(SiteServiceList As String)
| Parameter | Required | Description |
|---|---|---|
|
SiteServiceList |
Yes |
The semicolon-delimited list of Site.Services for which to display alarms. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool If lstBox.Selection = 0 Then CasCtrl.SetSiteServices("Company1.CAS") Elseif lstBox.Selection = 1 Then CasCtrl.SetSiteServices("Company2.CAS") Elseif lstBox.Selection = 2 Then CasCtrl.SetSiteServices("Company3.CAS") Else CasCtrl.SetSiteServices("Company4.CAS") End If CasCtrl.RefreshContents End Sub |
The SetSort method sets the sorting options.
SetSort(SortOrdinal As Long, Property As String, Ascending As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
SortOrdinal |
Yes |
The priority of the sort. The possible values for this parameter are 0, 1, and 2, with 0 being the highest sort priority. |
|
Property |
Yes |
The property to sort. |
|
Ascending |
Yes |
If this parameter is set to True, to the grid will sort in ascending order (A-Z). Otherwise, the grid will sort in descending order (Z-A). |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim bRet
bRet = CasCtrl.SetSort(0, "Primary Value", False)
If bRet = "False" Then msgbox "Error" End If
CasCtrl.RefreshContents End Sub |
The SetTooltipString method sets the tooltip display string.
SetTooltipString(TooltipString As String)
| Parameter | Required | Description |
|---|---|---|
|
TooltipString |
Yes |
The text to be displayed in the tooltip. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool strTooltip = CasCtrl.GetTooltipString
strTooltip = CasCtrl.TooltipTokenDlg CasCtrl.SetTooltipString strTooltip
End Sub |
The SetVisibleRow method automatically selects and scrolls the grid to the specified row.
SetVisibleRow(Row As Long) As Long
| Parameter | Required | Description |
|---|---|---|
|
Row |
Yes |
The number of the row to make visible. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim lValue lValue = edtVisibleRow.Text CasCtrl.SetVisibleRow lValue End Sub |
The ShowHiddenAlarms method sets whether or not hidden alarms are shown.
ShowHiddenAlarms(ShowHidden As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
ShowHidden |
Yes |
If this parameter is set to True, hidden alarms will be shown. Otherwise, hidden alarms will not be shown. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool Dim g_bShowHidden If (g_bShowHidden = True) Then g_bShowHidden = False Else g_bShowHidden = True End If CasCtrl.ShowHiddenAlarms g_bShowHidden CasCtrl.RefreshContents End Sub |
The SilenceAlarms method silences all alarms that would cause sounds that are older than or equal to the provided timestamp.
SilenceAlarms(SilenceTime)
| Parameter | Required | Description |
|---|---|---|
|
SilenceTime |
No |
This parameter is optional, if not specified the current time will be used. Any new alarms that come in after the time specified will cause sounds to play again. |
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.SilenceAlarms End Sub |
The StartRefresh method starts display refresh.
StartRefresh()
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.StartRefresh End Sub |
The StopRefresh method stops display refresh.
StopRefresh()
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool CasCtrl.StopRefresh End Sub |
The TooltipTokenDlg method displays a Tooltip Message Chooser dialog box, and returns the selected token string.
TootltipTokenDIg() As String
Example
|
Sub ButtonTool_EventClick() Dim This : Set This = ButtonTool strTooltip = CasCtrl.GetTooltipString strTooltip = CasCtrl.TooltipTokenDlg CasCtrl.SetTooltipString strTooltip End Sub |